﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace ShevaEngine.Core
{
    /// <summary>
    /// Log.
    /// </summary>
    public class ShevaLog
    {
        /// <summary>Singleton.</summary>
        public static readonly ShevaLog Instance = new ShevaLog();

        /// <summary>
        /// Konstruktor.
        /// </summary>
        public ShevaLog()
        {
#if WINDOWS
            TextWriterTraceListener fileListener = new TextWriterTraceListener(
                    System.IO.File.CreateText("ShevaEngine.log"));
            Debug.AutoFlush = true;
            Debug.Listeners.Add(fileListener);
#endif
            Debug.WriteLine(@"********************************************************************************");
            Debug.WriteLine(@"***************************** SHEVA GAME ENGINE 2 ******************************");
            Debug.WriteLine(@"******* Marek Novosad (marek.novosad@email.cz, http://www.manox.euweb.cz *******");
            Debug.WriteLine(@"******************************** (2008 - 2011)  ********************************");
            Debug.WriteLine(@"********************************************************************************");            
        }

        /// <summary>
        /// Metoda vypise radek textu.
        /// </summary>
        /// <param name="line"></param>
        public void AddInfoLine(string line)
        {
            Debug.WriteLine(line);
        }

        /// <summary>
        /// Metodfa vypise radky textu.
        /// </summary>
        /// <param name="lines"></param>
        public void AddInfoLines(string[] lines)
        {
            for (int i = 0; i < lines.Length; i++)
                Debug.WriteLine(lines[i]);
        }
    }
}
